﻿
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Text;
using Microsoft.Practices.Repository;
using Microsoft.Practices.EnterpriseLibrary.Data;
using DotNetCore.BannerManagement.Domain;
using System.Data.SqlClient;

namespace DotNetCore.BannerManagement.DAL.Domain.dnc_ZoneRepositoryArtifacts
{
    /// <summary>
    /// Construct a dnc_Zone object from OUT and IN/OUT parameters.
    /// </summary>
    internal sealed class Getdnc_ZoneByIDFactory : IDomainObjectFactory<dnc_Zone>
    {
        public dnc_Zone Construct(IDataReader reader)
        {
                  dnc_Zone dnc_Zone = new dnc_Zone();

            int zoneIDIndex = reader.GetOrdinal("ID");
            if (!reader.IsDBNull(zoneIDIndex))
            {
                dnc_Zone.ID = reader.GetInt32(zoneIDIndex);

            }

            int zoneNameIndex = reader.GetOrdinal("Name");
            if (!reader.IsDBNull(zoneNameIndex))
            {
                dnc_Zone.Name = reader.GetString(zoneNameIndex);

            }

            int zoneImageIDIndex = reader.GetOrdinal("ZoneImageId");
            if (!reader.IsDBNull(zoneImageIDIndex))
            {
                dnc_Zone.ZoneImageId = reader.GetInt32(zoneImageIDIndex);

            }

          
            return dnc_Zone;
        }

        }
    }


